package com.nuoniu.sibanyun.entity.crm.call.rongying;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;


/**
 * @ClassName RongYingResult
 * @Description TODO
 * @Author 白强
 * @Date 2022/6/16 11:41
 * @Version 1.0
 **/
@Data
@ApiModel("融营-返回结构")
public class RongYingResult<T>{

    @ApiModelProperty(value = "状态码 必选")
    private Integer Flag;

    @ApiModelProperty(value = "状态码注释 必选")
    private String Msg;

    @ApiModelProperty(value = "返回数据")
    private T Data;


    public static RongYingResult ok(String  message){
        return result(200,message,"ok");
    }

    public static RongYingResult error(int code, String  message) {
        return result(code,message,"error");
    }

    public static RongYingResult result(int code, String  message,Object result) {
        RongYingResult r = new RongYingResult();
        r.setFlag(code);
        r.setMsg( message);
        r.setData(result);
        return r;
    }
}
